import request from '@/utils/request'

/**
 * 获取角色列表
 */
export const getRoleListApi = data => {
  return request({
    method: 'get',
    url: '/auth/role',
    params: data
  })
}

/**
 * 删除角色
 */
export const delRoleApi = id => {
  return request({
    method: 'delete',
    url: `/auth/role/${id}`
  })
}

/**
 * 添加角色
 */
export const addRoleApi = data => {
  return request({
    method: 'post',
    url: '/auth/role',
    data
  })
}

/**
 * 获取角色详情
 */

export const getRoleDetailApi = id => {
  return request({
    method: 'get',
    url: `/auth/role/${id}`
  })
}

/**
 * 修改
 */
export const editRoleApi = data => {
  return request({
    method: 'put',
    url: `auth/role/${data.id}`,
    data
  })
}
